/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "class")
@NamedQueries({
    @NamedQuery(name = "Class.findAll", query = "SELECT c FROM Class c"),
    @NamedQuery(name = "Class.findByIdclass", query = "SELECT c FROM Class c WHERE c.idclass = :idclass"),
    @NamedQuery(name = "Class.findByClass", query = "SELECT c FROM Class c WHERE c.class1 = :class")})
public class Class implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idclass")
    private Integer idclass;
    @Basic(optional = false)
    @Column(name = "class")
    private String class1;
    @OneToMany(mappedBy = "class1", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Class() {
    }

    public Class(Integer idclass) {
        this.idclass = idclass;
    }

    public Class(Integer idclass, String class1) {
        this.idclass = idclass;
        this.class1 = class1;
    }

    public Integer getIdclass() {
        return idclass;
    }

    public void setIdclass(Integer idclass) {
        this.idclass = idclass;
    }

    public String getClass1() {
        return class1;
    }

    public void setClass1(String class1) {
        this.class1 = class1;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idclass != null ? idclass.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Class)) {
            return false;
        }
        Class other = (Class) object;
        if ((this.idclass == null && other.idclass != null) || (this.idclass != null && !this.idclass.equals(other.idclass))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Class[idclass=" + idclass + "]";
    }

}
